﻿<%@ Page Language="VB" CompilerOptions='/R:"C:\Program Files (x86)\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Microsoft.Data.Odbc" %>
<HTML>
<HEAD>
<SCRIPT Language="VB" Runat="server">
Sub Page_Load(Source as object, e as EventArgs)
Dim sConString As String = "DRIVER={MySQL ODBC 5.1 Driver}; SERVER=bluetonemedia.dyndns.org; DATABASE=asteriskcdrdb; UID=tbm; PASSWORD=tbm; OPTION=3;PORT=3306"
Dim oConnection as ODBCConnection = new ODBCConnection(sConString)
Dim sSQL as String = "SELECT * FROM cdr ORDER BY calldate DESC LIMIT 20"
Dim oDataAdapter as ODBCDataAdapter = New ODBCDataAdapter(sSQL, oConnection)
Dim oDataSet as DataSet = new DataSet()
oDataAdapter.Fill(oDataSet)
oDataGrid.DataSource = oDataSet
oDataGrid.DataBind()
End Sub
</SCRIPT >
</HEAD>
<BODY>
<ASP:DataGrid ID="oDataGrid" Runat="server" />
</BODY>
</HTML>
